class JrdService {
  constructor() {
    // 模拟优惠券数据
    this.couponList = [
      {
        balance: 500,
        exp_time: "2025-05-23"
      },
      {
        balance: 50839.96,
        exp_time: "2025-08-20"
      },
      {
        balance: 1000,
        exp_time: "2025-08-20"
      }
    ];

    // 模拟客服信息
    this.csInfo = {
      cs_no: "9901231",
      name: "小晗",
      phone: "13395495964",
      headimg: "https://cos-1254713619.cos.ap-shanghai.myqcloud.com/kuaiyouliang/pcweb/kf_headimg_xiaohan.png",
      qrcode_url: "https://cos-1254713619.cos.ap-shanghai.myqcloud.com/kuaiyouliang/pcweb/1745733868813.jpg"
    };

    // 模拟用户信息
    this.userInfo = {
      phone: "166****2416",
      last_time: "2025-05-22 14:03:34"
    };

    // 模拟优化目标分组数据
    this.groupList = [
      {
        group_name: "直播互动",
        icon: "https://cos-1254713619.cos.ap-shanghai.myqcloud.com/kyl_saas/img/%E8%B4%A6%E5%8F%B7%E5%85%B3%E6%B3%A8-%E7%9B%B4%E6%92%AD.png",
        title: "提升互动",
        goal_type_ids: [2]
      },
      {
        group_name: "直播观看",
        icon: "https://cos-1254713619.cos.ap-shanghai.myqcloud.com/kyl_saas/img/%E8%B4%A6%E5%8F%B7%E5%85%B3%E6%B3%A8-%E7%9B%B4%E6%92%AD.png",
        title: "提升观看",
        goal_type_ids: [1]
      },
      {
        group_name: "直播电商",
        icon: "https://cos-1254713619.cos.ap-shanghai.myqcloud.com/kyl_saas/img/%E8%B4%A6%E5%8F%B7%E5%85%B3%E6%B3%A8-%E7%9B%B4%E6%92%AD.png",
        title: "提高转化",
        goal_type_ids: [3]
      },
      {
        group_name: "短视频播放",
        icon: "https://cos-1254713619.cos.ap-shanghai.myqcloud.com/kyl_saas/img/%E8%B4%A6%E5%8F%B7%E5%85%B3%E6%B3%A8-%E7%9B%B4%E6%92%AD.png",
        title: "优化播放量",
        goal_type_ids: [4]
      },
      {
        group_name: "短视频带货",
        icon: "https://cos-1254713619.cos.ap-shanghai.myqcloud.com/kyl_saas/img/%E8%B4%A6%E5%8F%B7%E5%85%B3%E6%B3%A8-%E7%9B%B4%E6%92%AD.png",
        title: "提高转化",
        goal_type_ids: [5]
      }
    ];

    // 模拟登录状态管理
    this.loginStatus = {
      status: 0, // 0-未扫描，1-已扫描待确认，2-登录成功
      token: ""
    };

    // 模拟优化目标配置数据
    this.goalConfig = {
      goal_data: [
        {
          goal_type_id: 1,
          material_type: 2,
          goal_type: 1,
          goal_name: "直播-人气",
          pay_type_allow: [
            "1,3,5"
          ],
          auth_mode: 2,
          base_order_price: 100,
          base_num: 8000,
          base_put_num_min: 3
        },
        {
          goal_type_id: 2,
          material_type: 2,
          goal_type: 2,
          goal_name: "直播-互动",
          pay_type_allow: [
            "1,3,5"
          ],
          auth_mode: 2,
          base_order_price: 100,
          base_num: 3000,
          base_put_num_min: 2
        },
        {
          goal_type_id: 3,
          material_type: 2,
          goal_type: 3,
          goal_name: "直播-电商",
          pay_type_allow: [
            "1"
          ],
          auth_mode: 2,
          base_order_price: 100,
          base_num: 0,
          base_put_num_min: 4
        },
        {
          goal_type_id: 4,
          material_type: 1,
          goal_type: 4,
          goal_name: "短视频-播放",
          pay_type_allow: [
            "1,3,5"
          ],
          auth_mode: 1,
          base_order_price: 100,
          base_num: 15000,
          base_put_num_min: 2
        },
        {
          goal_type_id: 5,
          material_type: 1,
          goal_type: 5,
          goal_name: "短视频-电商",
          pay_type_allow: [
            "1"
          ],
          auth_mode: 2,
          base_order_price: 100,
          base_num: 0,
          base_put_num_min: 4
        }
      ],
      other_config: {
        sex_data: [
          {
            key: 2,
            value: "女"
          },
          {
            key: 1,
            value: "男"
          }
        ],
        age_data: [
          {
            key: "18-29",
            value: "18 ~ 29"
          },
          {
            key: "30-49",
            value: "30 ~ 49"
          },
          {
            key: "50-66",
            value: "50及以上"
          }
        ],
        crowd_data: [
          {
            key: 0,
            value: "系统推荐"
          },
          {
            key: 3,
            value: "自定义"
          }
        ],
        crowd_wxd_data: [
          {
            key: 0,
            value: "系统推荐"
          },
          {
            key: 3,
            value: "自定义"
          }
        ]
      }
    };
  }

  async getUserInfo(params) {
    try {
      // 这里实现获取用户信息的业务逻辑
      // 可以根据传入的参数进行个性化处理
      return {
        coupon_list: this.couponList,
        cs_info: this.csInfo,
        user_info: this.userInfo
      };
    } catch (error) {
      throw new Error(`获取用户信息失败: ${error.message}`);
    }
  }

  async getGroupList(params) {
    try {
      // 这里实现获取优化目标分组的业务逻辑
      // 可以根据传入的参数进行筛选或个性化处理
      return this.groupList;
    } catch (error) {
      throw new Error(`获取优化目标分组失败: ${error.message}`);
    }
  }

  async createLoginQrcode(params) {
    try {
      // 这里实现生成登录小程序码的业务逻辑
      // 在实际项目中，这里会调用微信API生成真实的小程序码
      return {
        qrcode_url: ""
      };
    } catch (error) {
      throw new Error(`生成登录小程序码失败: ${error.message}`);
    }
  }

  async checkScan(params) {
    try {
      // 这里实现检查扫码状态的业务逻辑
      // 在实际项目中，这里会查询数据库或缓存中的扫码状态
      // 为了演示轮询效果，可以根据时间或其他条件模拟不同状态
      
      // 模拟扫码状态变化：未扫描 -> 已扫描 -> 登录成功
      const now = Date.now();
      const simulatedStatus = Math.floor((now / 10000) % 3); // 每10秒循环一次状态
      
      let status = 0;
      let token = "";
      
      if (simulatedStatus === 1) {
        status = 1; // 已扫描待确认
      } else if (simulatedStatus === 2) {
        status = 2; // 登录成功
        token = "mock_token_" + now;
      }
      
      return {
        status,
        token
      };
    } catch (error) {
      throw new Error(`检查扫码状态失败: ${error.message}`);
    }
  }

  async quit(params) {
    try {
      // 这里实现退出登录的业务逻辑
      // 在实际项目中，这里会清除用户的登录状态和token
      
      // 模拟登录失效错误
      const error = new Error("登录失效");
      error.code = -1001;
      throw error;
    } catch (error) {
      // 如果是我们自定义的登录失效错误，直接抛出
      if (error.code === -1001) {
        throw error;
      }
      // 其他错误
      throw new Error(`退出登录失败: ${error.message}`);
    }
  }

  async getGoalConfig(params) {
    try {
      // 这里实现获取优化目标配置的业务逻辑
      // 可以根据传入的参数进行筛选或个性化处理
      return this.goalConfig;
    } catch (error) {
      throw new Error(`获取优化目标配置失败: ${error.message}`);
    }
  }

  async searchAccountAuth(params) {
    try {
      // 这里实现查询账号信息及授权状态的业务逻辑
      // 在实际项目中，这里会根据account_name和goal_type_id查询数据库
      const { account_name, goal_type_id } = params;
      
      // 模拟不同账号的返回数据
      const mockAccounts = {
        "多宝福袋": {
          account_name: "多宝福袋",
          auth_mode: "2", // 授权方式：1下单前授权 2下单后授权
          auth_status: "true", // 已授权状态
          authorization_qr_code_url: "http://wxsnsencsvp.wxs.qq.com/141/20204/snscwg", // 授权二维码
          wechat_channels_account_icon: "http://wx.qlogo.cn/finderhead/5bgJX7GXzg/132", // 视频号头像
          wechat_channels_account_id: "export/UzFfAgtw" // 视频账号id
        },
        "测试账号": {
          account_name: "测试账号",
          auth_mode: "1",
          auth_status: "false",
          authorization_qr_code_url: "http://wxsnsencsvp.wxs.qq.com/141/20204/testqr",
          wechat_channels_account_icon: "http://wx.qlogo.cn/finderhead/testicon/132",
          wechat_channels_account_id: "export/TestAccount"
        }
      };
      
      // 如果找到匹配的账号，返回对应数据，否则返回默认数据
      const accountData = mockAccounts[account_name] || {
        account_name: account_name || "",
        auth_mode: "2",
        auth_status: "true",
        authorization_qr_code_url: "http://wxsnsencsvp.wxs.qq.com/141/20204/default",
        wechat_channels_account_icon: "http://wx.qlogo.cn/finderhead/default/132",
        wechat_channels_account_id: "export/DefaultAccount"
      };
      
      return accountData;
    } catch (error) {
      throw new Error(`查询账号信息及授权状态失败: ${error.message}`);
    }
  }

  async searchWxdAccount(params) {
    try {
      // 这里实现查询账号信息-电商专用的业务逻辑
      // 在实际项目中，这里会根据传入参数查询微信视频号电商账号信息
      const { account_name } = params;
      
      // 模拟电商专用账号数据
      const mockWxdAccounts = {
        "多宝福袋": {
          account_name: "多宝福袋",
          headimg: "http://wx.qlogo.cn/finderhead/5l9zbxNzk0kz9hibXn3K5ibvs5LzMibgJX7GzVjW8h8Xzg/0"
        },
        "电商测试账号": {
          account_name: "电商测试账号",
          headimg: "http://wx.qlogo.cn/finderhead/testEcommerce/0"
        },
        "直播带货小店": {
          account_name: "直播带货小店",
          headimg: "http://wx.qlogo.cn/finderhead/liveShop/0"
        }
      };
      
      // 如果找到匹配的账号，返回对应数据，否则返回默认数据
      const accountData = mockWxdAccounts[account_name] || {
        account_name: account_name || "",
        headimg: "http://wx.qlogo.cn/finderhead/default/0"
      };
      
      return accountData;
    } catch (error) {
      throw new Error(`查询电商账号信息失败: ${error.message}`);
    }
  }

  async getCrowdList(params) {
    try {
      // 这里实现获取自定义人群画像列表的业务逻辑
      // 在实际项目中，这里会从数据库查询完整的人群画像分类数据
      
      // 模拟完整的人群画像分类数据
      const crowdListData = [
        {
          id: 2,
          name: "孕产育儿",
          parent_id: 0,
          audience_id: 2,
          child_data: [
            {
              id: 130,
              name: "玩具模型",
              parent_id: 2,
              audience_id: 42889389,
              child_data: null
            },
            {
              id: 131,
              name: "童鞋服装",
              parent_id: 2,
              audience_id: 42889388,
              child_data: null
            },
            {
              id: 132,
              name: "童车床座",
              parent_id: 2,
              audience_id: 42889387,
              child_data: null
            },
            {
              id: 133,
              name: "母婴食品",
              parent_id: 2,
              audience_id: 42889386,
              child_data: null
            },
            {
              id: 134,
              name: "母婴护理",
              parent_id: 2,
              audience_id: 42889385,
              child_data: null
            }
          ]
        },
        {
          id: 3,
          name: "游戏",
          parent_id: 0,
          audience_id: 3,
          child_data: [
            {
              id: 135,
              name: "游戏",
              parent_id: 3,
              audience_id: 42889384,
              child_data: null
            }
          ]
        },
        {
          id: 4,
          name: "医疗健康",
          parent_id: 0,
          audience_id: 4,
          child_data: [
            {
              id: 21,
              name: "药品器械",
              parent_id: 4,
              audience_id: 42889381,
              child_data: null
            },
            {
              id: 22,
              name: "成人用品",
              parent_id: 4,
              audience_id: 42889379,
              child_data: null
            },
            {
              id: 23,
              name: "保健养生",
              parent_id: 4,
              audience_id: 42889375,
              child_data: null
            },
            {
              id: 136,
              name: "药品器械",
              parent_id: 4,
              audience_id: 42889383,
              child_data: null
            }
          ]
        },
        {
          id: 5,
          name: "生活资讯",
          parent_id: 0,
          audience_id: 5,
          child_data: [
            {
              id: 24,
              name: "政治",
              parent_id: 5,
              audience_id: 42889374,
              child_data: null
            },
            {
              id: 25,
              name: "八卦",
              parent_id: 5,
              audience_id: 42889373,
              child_data: null
            },
            {
              id: 26,
              name: "世界资讯",
              parent_id: 5,
              audience_id: 42889369,
              child_data: null
            },
            {
              id: 27,
              name: "时尚穿搭",
              parent_id: 5,
              audience_id: 42889366,
              child_data: null
            }
          ]
        },
        {
          id: 6,
          name: "新闻咨询",
          parent_id: 0,
          audience_id: 6,
          child_data: [
            {
              id: 28,
              name: "生活资讯",
              parent_id: 6,
              audience_id: 42889364,
              child_data: null
            },
            {
              id: 29,
              name: "商业与经济",
              parent_id: 6,
              audience_id: 42889362,
              child_data: null
            },
            {
              id: 30,
              name: "法律",
              parent_id: 6,
              audience_id: 42889360,
              child_data: null
            },
            {
              id: 31,
              name: "本地资讯",
              parent_id: 6,
              audience_id: 42889359,
              child_data: null
            }
          ]
        },
        {
          id: 7,
          name: "体育运动",
          parent_id: 0,
          audience_id: 7,
          child_data: [
            {
              id: 32,
              name: "服饰鞋包",
              parent_id: 7,
              audience_id: 42889358,
              child_data: null
            },
            {
              id: 33,
              name: "瑜伽",
              parent_id: 7,
              audience_id: 42889355,
              child_data: null
            },
            {
              id: 34,
              name: "体育用品",
              parent_id: 7,
              audience_id: 42889353,
              child_data: null
            },
            {
              id: 35,
              name: "水上运动",
              parent_id: 7,
              audience_id: 42889351,
              child_data: null
            },
            {
              id: 36,
              name: "射击",
              parent_id: 7,
              audience_id: 42889349,
              child_data: null
            },
            {
              id: 37,
              name: "球类运动",
              parent_id: 7,
              audience_id: 42889346,
              child_data: null
            },
            {
              id: 38,
              name: "跑步骑行",
              parent_id: 7,
              audience_id: 42889345,
              child_data: null
            },
            {
              id: 39,
              name: "健身产品与服务",
              parent_id: 7,
              audience_id: 42889344,
              child_data: null
            },
            {
              id: 40,
              name: "极限运动",
              parent_id: 7,
              audience_id: 42889343,
              child_data: null
            },
            {
              id: 41,
              name: "户外装备",
              parent_id: 7,
              audience_id: 42889341,
              child_data: null
            },
            {
              id: 42,
              name: "户外运动",
              parent_id: 7,
              audience_id: 42889340,
              child_data: null
            },
            {
              id: 43,
              name: "户外鞋服",
              parent_id: 7,
              audience_id: 42889339,
              child_data: null
            },
            {
              id: 44,
              name: "格斗",
              parent_id: 7,
              audience_id: 42889337,
              child_data: null
            }
          ]
        },
        {
          id: 8,
          name: "生活服务",
          parent_id: 0,
          audience_id: 8,
          child_data: [
            {
              id: 45,
              name: "摄影写真",
              parent_id: 8,
              audience_id: 42889333,
              child_data: null
            },
            {
              id: 46,
              name: "农资绿植",
              parent_id: 8,
              audience_id: 42889332,
              child_data: null
            },
            {
              id: 47,
              name: "礼品鲜花",
              parent_id: 8,
              audience_id: 42889330,
              child_data: null
            },
            {
              id: 48,
              name: "家政",
              parent_id: 8,
              audience_id: 42889329,
              child_data: null
            },
            {
              id: 49,
              name: "婚纱摄影",
              parent_id: 8,
              audience_id: 42889328,
              child_data: null
            },
            {
              id: 50,
              name: "婚恋交友",
              parent_id: 8,
              audience_id: 42889327,
              child_data: null
            },
            {
              id: 51,
              name: "购物平台",
              parent_id: 8,
              audience_id: 42889326,
              child_data: null
            },
            {
              id: 52,
              name: "二手物品",
              parent_id: 8,
              audience_id: 42889325,
              child_data: null
            },
            {
              id: 53,
              name: "电子产品维修",
              parent_id: 8,
              audience_id: 42889324,
              child_data: null
            },
            {
              id: 54,
              name: "宠物",
              parent_id: 8,
              audience_id: 42889321,
              child_data: null
            }
          ]
        },
        {
          id: 9,
          name: "商务服务",
          parent_id: 0,
          audience_id: 9,
          child_data: [
            {
              id: 55,
              name: "专业咨询",
              parent_id: 9,
              audience_id: 42889314,
              child_data: null
            },
            {
              id: 56,
              name: "招商加盟",
              parent_id: 9,
              audience_id: 42889305,
              child_data: null
            },
            {
              id: 57,
              name: "展会服务",
              parent_id: 9,
              audience_id: 42889296,
              child_data: null
            },
            {
              id: 58,
              name: "营销广告",
              parent_id: 9,
              audience_id: 42889295,
              child_data: null
            },
            {
              id: 59,
              name: "物流运输",
              parent_id: 9,
              audience_id: 42889293,
              child_data: null
            },
            {
              id: 60,
              name: "求职招聘",
              parent_id: 9,
              audience_id: 42889289,
              child_data: null
            },
            {
              id: 61,
              name: "农林牧渔",
              parent_id: 9,
              audience_id: 42889287,
              child_data: null
            },
            {
              id: 62,
              name: "节能环保",
              parent_id: 9,
              audience_id: 42889284,
              child_data: null
            },
            {
              id: 63,
              name: "建筑工程",
              parent_id: 9,
              audience_id: 42889283,
              child_data: null
            },
            {
              id: 64,
              name: "机械器材",
              parent_id: 9,
              audience_id: 42889281,
              child_data: null
            },
            {
              id: 65,
              name: "化工材料",
              parent_id: 9,
              audience_id: 42889278,
              child_data: null
            },
            {
              id: 66,
              name: "法律服务",
              parent_id: 9,
              audience_id: 42889276,
              child_data: null
            }
          ]
        },
        {
          id: 10,
          name: "美容个护",
          parent_id: 0,
          audience_id: 10,
          child_data: [
            {
              id: 67,
              name: "美妆护肤",
              parent_id: 10,
              audience_id: 42889275,
              child_data: null
            },
            {
              id: 68,
              name: "美妆护肤",
              parent_id: 10,
              audience_id: 42889273,
              child_data: null
            },
            {
              id: 69,
              name: "减肥瘦身",
              parent_id: 10,
              audience_id: 42889270,
              child_data: null
            },
            {
              id: 70,
              name: "个人护理",
              parent_id: 10,
              audience_id: 42889268,
              child_data: null
            }
          ]
        },
        {
          id: 11,
          name: "旅游",
          parent_id: 0,
          audience_id: 11,
          child_data: [
            {
              id: 71,
              name: "主题旅游",
              parent_id: 11,
              audience_id: 42889134,
              child_data: null
            },
            {
              id: 72,
              name: "旅行社服务",
              parent_id: 11,
              audience_id: 42889132,
              child_data: null
            },
            {
              id: 73,
              name: "酒店住宿",
              parent_id: 11,
              audience_id: 42889126,
              child_data: null
            },
            {
              id: 74,
              name: "境外游",
              parent_id: 11,
              audience_id: 42889122,
              child_data: null
            },
            {
              id: 75,
              name: "景点票务",
              parent_id: 11,
              audience_id: 42889111,
              child_data: null
            },
            {
              id: 76,
              name: "交通票务",
              parent_id: 11,
              audience_id: 42889109,
              child_data: null
            },
            {
              id: 77,
              name: "国内游",
              parent_id: 11,
              audience_id: 42889106,
              child_data: null
            }
          ]
        },
        {
          id: 12,
          name: "金融",
          parent_id: 0,
          audience_id: 12,
          child_data: [
            {
              id: 78,
              name: "证券",
              parent_id: 12,
              audience_id: 42889102,
              child_data: null
            },
            {
              id: 79,
              name: "银行",
              parent_id: 12,
              audience_id: 42889099,
              child_data: null
            },
            {
              id: 80,
              name: "互联网金融",
              parent_id: 12,
              audience_id: 42889096,
              child_data: null
            },
            {
              id: 81,
              name: "保险",
              parent_id: 12,
              audience_id: 42889094,
              child_data: null
            }
          ]
        },
        {
          id: 13,
          name: "教育",
          parent_id: 0,
          audience_id: 13,
          child_data: [
            {
              id: 82,
              name: "中小学教育",
              parent_id: 13,
              audience_id: 42889092,
              child_data: null
            },
            {
              id: 83,
              name: "职业教育",
              parent_id: 13,
              audience_id: 42889089,
              child_data: null
            },
            {
              id: 84,
              name: "早教与学前教育",
              parent_id: 13,
              audience_id: 42889086,
              child_data: null
            },
            {
              id: 85,
              name: "语言培训",
              parent_id: 13,
              audience_id: 42889084,
              child_data: null
            },
            {
              id: 86,
              name: "学历教育",
              parent_id: 13,
              audience_id: 42889081,
              child_data: null
            },
            {
              id: 87,
              name: "兴趣教育",
              parent_id: 13,
              audience_id: 42889077,
              child_data: null
            },
            {
              id: 88,
              name: "非学历教育",
              parent_id: 13,
              audience_id: 42889074,
              child_data: null
            },
            {
              id: 89,
              name: "出国留学/移民",
              parent_id: 13,
              audience_id: 42889072,
              child_data: null
            }
          ]
        },
        {
          id: 14,
          name: "交通",
          parent_id: 0,
          audience_id: 14,
          child_data: [
            {
              id: 90,
              name: "汽车租赁",
              parent_id: 14,
              audience_id: 42889067,
              child_data: null
            },
            {
              id: 91,
              name: "汽车用品",
              parent_id: 14,
              audience_id: 42889065,
              child_data: null
            },
            {
              id: 92,
              name: "汽车服务",
              parent_id: 14,
              audience_id: 42889063,
              child_data: null
            },
            {
              id: 93,
              name: "汽车",
              parent_id: 14,
              audience_id: 42889062,
              child_data: null
            },
            {
              id: 94,
              name: "摩托车",
              parent_id: 14,
              audience_id: 42889061,
              child_data: null
            },
            {
              id: 95,
              name: "二手汽车",
              parent_id: 14,
              audience_id: 42889058,
              child_data: null
            },
            {
              id: 96,
              name: "电动车",
              parent_id: 14,
              audience_id: 42889055,
              child_data: null
            }
          ]
        },
        {
          id: 15,
          name: "家居",
          parent_id: 0,
          audience_id: 15,
          child_data: [
            {
              id: 97,
              name: "生活用品",
              parent_id: 15,
              audience_id: 42889052,
              child_data: null
            },
            {
              id: 98,
              name: "家用电器",
              parent_id: 15,
              audience_id: 42889051,
              child_data: null
            },
            {
              id: 99,
              name: "家具家纺",
              parent_id: 15,
              audience_id: 42889050,
              child_data: null
            },
            {
              id: 100,
              name: "家居装修",
              parent_id: 15,
              audience_id: 42889047,
              child_data: null
            },
            {
              id: 101,
              name: "厨具餐具",
              parent_id: 15,
              audience_id: 42889045,
              child_data: null
            }
          ]
        },
        {
          id: 17,
          name: "电子产品",
          parent_id: 0,
          audience_id: 17,
          child_data: [
            {
              id: 103,
              name: "智能设备",
              parent_id: 17,
              audience_id: 42889043,
              child_data: null
            },
            {
              id: 104,
              name: "手机及配件",
              parent_id: 17,
              audience_id: 42889041,
              child_data: null
            },
            {
              id: 105,
              name: "摄影摄像",
              parent_id: 17,
              audience_id: 42889036,
              child_data: null
            },
            {
              id: 106,
              name: "电玩/游戏机/学习机",
              parent_id: 17,
              audience_id: 42888997,
              child_data: null
            },
            {
              id: 107,
              name: "电脑整机",
              parent_id: 17,
              audience_id: 42888990,
              child_data: null
            },
            {
              id: 108,
              name: "电脑配件",
              parent_id: 17,
              audience_id: 42888969,
              child_data: null
            },
            {
              id: 109,
              name: "办公设备",
              parent_id: 17,
              audience_id: 42888937,
              child_data: null
            }
          ]
        },
        {
          id: 18,
          name: "服饰鞋帽箱包",
          parent_id: 0,
          audience_id: 18,
          child_data: [
            {
              id: 110,
              name: "珠宝首饰",
              parent_id: 18,
              audience_id: 42888899,
              child_data: null
            },
            {
              id: 111,
              name: "钟表",
              parent_id: 18,
              audience_id: 42888894,
              child_data: null
            },
            {
              id: 112,
              name: "奢侈品",
              parent_id: 18,
              audience_id: 42888882,
              child_data: null
            },
            {
              id: 113,
              name: "女装",
              parent_id: 18,
              audience_id: 42888881,
              child_data: null
            },
            {
              id: 114,
              name: "女鞋",
              parent_id: 18,
              audience_id: 42888878,
              child_data: null
            },
            {
              id: 115,
              name: "女士箱包",
              parent_id: 18,
              audience_id: 42888874,
              child_data: null
            },
            {
              id: 116,
              name: "内衣/家居服",
              parent_id: 18,
              audience_id: 42888871,
              child_data: null
            },
            {
              id: 117,
              name: "男装",
              parent_id: 18,
              audience_id: 42888870,
              child_data: null
            },
            {
              id: 118,
              name: "男鞋",
              parent_id: 18,
              audience_id: 42888869,
              child_data: null
            },
            {
              id: 119,
              name: "男士箱包",
              parent_id: 18,
              audience_id: 42888839,
              child_data: null
            },
            {
              id: 120,
              name: "功能箱包",
              parent_id: 18,
              audience_id: 42888838,
              child_data: null
            },
            {
              id: 121,
              name: "服饰配件",
              parent_id: 18,
              audience_id: 42888834,
              child_data: null
            }
          ]
        },
        {
          id: 19,
          name: "房产",
          parent_id: 0,
          audience_id: 19,
          child_data: [
            {
              id: 122,
              name: "房屋租赁",
              parent_id: 19,
              audience_id: 42888826,
              child_data: null
            },
            {
              id: 123,
              name: "房产交易",
              parent_id: 19,
              audience_id: 42888823,
              child_data: null
            }
          ]
        },
        {
          id: 20,
          name: "餐饮美食",
          parent_id: 0,
          audience_id: 20,
          child_data: [
            {
              id: 124,
              name: "饮料",
              parent_id: 20,
              audience_id: 42888818,
              child_data: null
            },
            {
              id: 125,
              name: "食品烟草生鲜",
              parent_id: 20,
              audience_id: 42888814,
              child_data: null
            },
            {
              id: 126,
              name: "烹饪/菜谱",
              parent_id: 20,
              audience_id: 42888811,
              child_data: null
            },
            {
              id: 127,
              name: "美食",
              parent_id: 20,
              audience_id: 42888807,
              child_data: null
            },
            {
              id: 128,
              name: "酒水",
              parent_id: 20,
              audience_id: 42888805,
              child_data: null
            }
          ]
        }
      ];
      
      return crowdListData;
    } catch (error) {
      throw new Error(`获取自定义人群画像列表失败: ${error.message}`);
    }
  }

  async getCrowdWxdList(params) {
    try {
      // 这里实现获取自定义人群画像-电商专用列表的业务逻辑
      // 在实际项目中，这里会从数据库查询电商专用的人群画像标签数据
      
      // 模拟电商专用人群画像标签数据
      const crowdWxdListData = [
        {
          id: 1,
          label_id: "1001",
          label_name: "个人护理",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 2,
          label_id: "1069",
          label_name: "农资园艺",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 3,
          label_id: "1142",
          label_name: "厨具",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 4,
          label_id: "1208",
          label_name: "宠物生活",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 5,
          label_id: "1247",
          label_name: "家具",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 6,
          label_id: "1421",
          label_name: "家居日用",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 7,
          label_id: "1453",
          label_name: "家庭清洁/纸品",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 8,
          label_id: "1495",
          label_name: "家用电器",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 9,
          label_id: "1653",
          label_name: "家纺",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 10,
          label_id: "1701",
          label_name: "家装建材",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 11,
          label_id: "1941",
          label_name: "手机通讯",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 12,
          label_id: "1972",
          label_name: "数码",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 13,
          label_id: "6033",
          label_name: "服饰内衣",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 14,
          label_id: "6153",
          label_name: "母婴",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 15,
          label_id: "6263",
          label_name: "汽车用品",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 16,
          label_id: "6472",
          label_name: "玩具乐器",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 17,
          label_id: "6625",
          label_name: "生鲜",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 18,
          label_id: "6706",
          label_name: "电脑、办公",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 19,
          label_id: "6831",
          label_name: "箱包皮具",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 20,
          label_id: "6870",
          label_name: "美妆护肤",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 21,
          label_id: "6932",
          label_name: "运动户外",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 22,
          label_id: "7339",
          label_name: "酒类",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 23,
          label_id: "7363",
          label_name: "钟表",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 24,
          label_id: "7378",
          label_name: "鞋靴",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 25,
          label_id: "7419",
          label_name: "食品饮料",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 26,
          label_id: "135835",
          label_name: "图书",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 27,
          label_id: "378136",
          label_name: "珠宝首饰",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 28,
          label_id: "381003",
          label_name: "教育培训",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 29,
          label_id: "530032",
          label_name: "文玩",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 30,
          label_id: "400111",
          label_name: "知识教学",
          ext_info: "",
          label_level: 1,
          is_del: 0
        },
        {
          id: 31,
          label_id: "400222",
          label_name: "游戏",
          ext_info: "",
          label_level: 1,
          is_del: 0
        }
      ];
      
      return crowdWxdListData;
    } catch (error) {
      throw new Error(`获取自定义人群画像-电商专用列表失败: ${error.message}`);
    }
  }

  async getVideoList(params) {
    try {
      // 这里实现获取加热视频(单选)的业务逻辑
      // 在实际项目中，这里会从数据库或视频号API查询可用的视频列表
      // 可以根据传入的参数进行筛选，如账号名称、视频类型等
      
      // 模拟视频列表数据（单选）
      const videoListData = {
        list: [
          // 当前返回空列表，表示暂无可用视频
          // 在实际实现中，这里会包含视频信息，如：
          // {
          //   video_id: "video123",
          //   title: "视频标题",
          //   cover_url: "http://example.com/cover.jpg",
          //   duration: 30,
          //   create_time: "2025-01-26 10:00:00"
          // }
        ]
      };
      
      return videoListData;
    } catch (error) {
      throw new Error(`获取加热视频列表失败: ${error.message}`);
    }
  }

  async getWxdVideoList(params) {
    try {
      // 这里实现获取加热视频(多选)-电商专用的业务逻辑
      // 在实际项目中，这里会从数据库或视频号API查询电商相关的视频列表
      // 支持分页查询，可以根据last_buffer进行翻页
      
      // 模拟电商专用视频列表数据（多选）
      const wxdVideoListData = {
        continue_flag: false, // 是否还有更多数据
        last_buffer: "CICAgKCXja/AywEQAA==", // 分页标识，用于下次查询
        list: [
          // 当前返回空列表，表示暂无可用视频
          // 在实际实现中，这里会包含电商视频信息，如：
          // {
          //   video_id: "wxd_video123",
          //   title: "电商视频标题",
          //   cover_url: "http://example.com/wxd_cover.jpg",
          //   duration: 60,
          //   create_time: "2025-01-26 10:00:00",
          //   is_commerce: true,
          //   product_info: {
          //     product_id: "prod123",
          //     product_name: "商品名称"
          //   }
          // }
        ]
      };
      
      return wxdVideoListData;
    } catch (error) {
      throw new Error(`获取电商加热视频列表失败: ${error.message}`);
    }
  }
}

module.exports = new JrdService();
